package com.lm.lm.apollo.client.controller;

import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lm_jcf
 * @date 2019/7/23 10:57
 */
@RestController
public class ApolloController {

    @Value("${app_path}")
    private String appPath;

    @RequestMapping("/get_properties")
    public void get(){
        Config config = ConfigService.getAppConfig();
        String value = config.getProperty("server.name", "null");
        System.out.println(value);

        System.out.println("========");
        System.out.println(appPath);
    }
}
